package day02;

import java.util.Scanner;

/**
 *
 * Created by MGL on 2017/4/3.
 */
public class Test01 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        while (sc.hasNext()) {
            int m = sc.nextInt();
            System.out.println(m & (-m));
        }

    }
}
